<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">
    <h1>
        修改串料申请
    </h1>
</section>
<section class="content">
    <form method="post" class="form-horizontal" role="form"
          enctype="multipart/form-data">
        <input type="hidden" id="ceoId" name="ceoId" th:value="${changeOrder.ceoId}">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <div class="col-md-4 col-md-offset-5">
                        <h3>串料申请基本信息</h3>
                        </div>
                        <div class="col-md-3">单据编号：
                            <label th:text="${changeOrder.ceoCode}"></label>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-md-10 col-md-offset-1">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">需求项目编号</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control"
                                                       th:value="${changeOrder.ceoNeedCode}" readonly="readonly"
                                                       autocomplete="off"
                                                       placeholder="需求项目编号">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">挪用项目编号</label>
                                            <div class="col-sm-9">
                                                <input type="text" readonly="readonly" class="form-control"
                                                       th:value="${changeOrder.ceoLendCode}"
                                                       autocomplete="off" placeholder="挪用项目编号">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">需求项目名称</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control"
                                                       th:value="${changeOrder.ceoNeedName}" readonly="readonly"
                                                       autocomplete="off"
                                                       placeholder="需求项目名称">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">挪用项目名称</label>
                                            <div class="col-sm-9">
                                                <input type="text" readonly="readonly" class="form-control"
                                                       th:value="${changeOrder.ceoLendName}" autocomplete="off"
                                                       placeholder="挪用项目名称">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">计划归还编码</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control" id="ceoNeedTrackCode"
                                                       th:value="${changeOrder.ceoNeedTrackCode}"
                                                       autocomplete="off"
                                                       placeholder="计划归还编码">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">挪用计划编码</label>
                                            <div class="col-sm-9">
                                                <input type="text" readonly="readonly"
                                                       th:value="${changeOrder.ceoLendTrackCode}" class="form-control"
                                                       autocomplete="off"
                                                       placeholder="挪用计划编码">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">名称材质规格</label>
                                            <div class="col-sm-9">
                                                <input type="text" readonly="readonly" class="form-control"
                                                       autocomplete="off"
                                                       placeholder="名称材质规格" th:value="${changeOrder.ceoNeedMatDesc}">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">名称材质规格</label>
                                            <div class="col-sm-9">
                                                <input type="text" readonly="readonly" class="form-control"
                                                       autocomplete="off"
                                                       placeholder="名称材质规格" th:value="${changeOrder.ceoLendMatDesc}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">需求数量</label>
                                            <div class="col-sm-3">
                                                <input type="number" step="0.1"
                                                       class="form-control"
                                                       autocomplete="off" readonly="readonly" placeholder="数量"
                                                       th:value="${changeOrder.ceoNeedQty}">
                                            </div>
                                            <label class="col-sm-3 control-label">需求重量</label>
                                            <div class="col-sm-3">
                                                <input type="number" step="0.1"
                                                       class="form-control"
                                                       autocomplete="off" readonly="readonly" placeholder="重量"
                                                       th:value="${changeOrder.ceoNeedWgt}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">使用部门</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control" readonly="readonly"
                                                       autocomplete="off"
                                                       placeholder="使用部门"
                                                       th:value="${changeOrder.ceoNeedDept}">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">所在部门</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control" readonly="readonly"
                                                       autocomplete="off"
                                                       placeholder="所在部门"
                                                       th:value="${changeOrder.ceoLendDept}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <hr>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">是否需要还料</label>
                                            <div class="col-sm-1" style="width: 30px;padding-top: 6px;">
                                                <input type="radio" readonly="readonly" name="ceoReturnFlg" value="1"
                                                       th:checked="${changeOrder.ceoReturnFlg == 1}">
                                            </div>
                                            <label class="col-sm-2 control-label pull-left"
                                                   style="width: 55px;padding-left: 0px;">需要</label>
                                            <div class="col-sm-1"
                                                 style="width: 30px;padding-top: 6px;padding-left: 50px;">
                                                <input type="radio" readonly="readonly" name="ceoReturnFlg" value="2"
                                                       th:checked="${changeOrder.ceoReturnFlg == 2}">
                                            </div>
                                            <label class="col-sm-2 control-label pull-left"
                                                   style="width: 65px;padding-left: 0px;">不需要</label>
                                        </div>
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">需求项目生产状况</label>
                                    <div class="col-sm-11">
                                        <textarea rows="3" class="form-control" autocomplete="off" readonly="readonly"
                                                  placeholder="需求项目生产状况"
                                                  th:text="${changeOrder.ceoNeedDesc}"></textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">挪用项目生产状况</label>
                                    <div class="col-sm-11">
                                        <textarea rows="3" class="form-control" autocomplete="off" readonly="readonly"
                                                  placeholder="被挪用项目生产状况"
                                                  th:text="${changeOrder.ceoLendDesc}"></textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">备注</label>
                                    <div class="col-sm-11">
                                        <textarea rows="2" class="form-control" autocomplete="off" readonly="readonly"
                                                  placeholder="备注"
                                                  th:text="${changeOrder.ceoRemark}"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-md-2 col-md-offset-1">
                                <label>制单人：</label><label th:text="${changeOrder.ceoBillUser}"></label>
                            </div>
                            <div class="col-md-7">
                                <label>制单时间：</label>
                                <label th:text="${#dates.format(changeOrder.ceoBillDate, 'yyyy-MM-dd hh:mm:ss')}"></label>
                            </div>
                            <div class="col-md-2">
                                <button type="button" id="btn_create" class="btn btn-info pull-left"
                                        onclick="updateOther()">提交
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>
<div th:include="include :: footer"></div>
<script>

    /**
     * 被执行后的串料申请修改
     * 暂定可以修改内容：计划归还编码
     */
    function updateOther() {

        js.post({
            url: ctx + "material/changeOrder/editOther",
            data: {
                ceoId: $("#ceoId").val(),
                ceoNeedTrackCode: $("#ceoNeedTrackCode").val()
            },
            success: function (result) {
                location.href = ctx + "material/changeOrder/page";
            }
        })

    }

</script>
</body>
</html>